<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车页面</title>
    <link rel="stylesheet" rel="icon" href="/mi/css/cart/shooping_cart.css" type="text/css" />
    <link rel="stylesheet" href="/mi/plugins/bootstrap-3.4.1-dist/css/bootstrap.css">
    <link rel="stylesheet" href="/mi/css/common/page_bottom.css">
    <link rel="stylesheet" href="/mi/css/iconfont/iconfont.css">
    <link rel="icon" href="/mi/imgs/favicon.ico" type="image/x-icon" />

    <style>
        a:hover{
            text-decoration: none;
            color: rgb(255, 103, 0);
        }
    </style>
</head>
<body >
    <div class="header">
        <div class="header-nav">
            <div class="header-log" >
                <a href="/mi/index" target="_blank">
                    <img src="/mi/imgs/mi.png" alt="">
                </a>
            </div>
            <div class="header-middler">
                <h2>我的购物车</h2>
                <p>温馨提示：产品是否购买成功，以最终下单为准哦，请尽快结算</p>
            </div>
            <div class="header-last">
                <a href="/mi/personal_center/portal.jsp">
                    ${sessionScope.user.userName}
                </a>
                <span>|</span>
                <a href="/mi/order/order_list">我的订单</a>
            </div>
        </div>
    </div>
    <div class="middler">
        <div class="middler-header">
            <div class="middler-child">
                <div class="middler-header-one">
                    <input type="checkbox" onclick="selectAll(this)" id="checkBoss"> 全选
                </div>
                <div class="middler-header-two"></div>
                <div class="middler-header-three">商品名称</div>
                <div class="middler-header-four">单价</div>
                <div class="middler-header-five">数量</div>
                <div class="middler-header-six">小计</div>
                <div class="middler-header-seven">操作</div>
            </div>
            <div class="middler-nav" id="middler_nav">


                <%--购物车的异步刷新--%>
                <div id="outer"></div>




                <div class="middler-last">
                    <div class="middler-last-one">
                        <a href="">继续购物&nbsp;<span>|</span></a>
                        <span>共<span class="three" id="totalNumberCart">${products.size()}</span>件商品,已选择<span class="three"  id="selectedNumber">0</span>件</span>
                    </div>
                    <div class="middler-last-two">
                        <div class="two">
                            <input id="toSettle" type="button" disabled="true"  value="去结算" style="width: 200px; height: 50px; border: 0px;">
                        </div>
                        <div class="one">
                            <a href="" id="countTotal">合计:&nbsp;<em>0</em>&nbsp;元</a>
                        </div>
                    </div>
                </div>
            </div>

        </div>


        <div class="end" style="margin: auto;">
            <div class="last">
                <div class="last-one"></div>
                <div class="last-two">
                    <a href="">买购物车中商品的人还买了</a>
                </div>
                <div class="last-three"></div>
            </div>
        </div>

        <!-- 猜你喜欢部分 -->
        <div class="tail" style="margin: auto">
            <div class="tail-one cc">
                <img src="/mi/imgs/like1.png" alt="">
                <h3>小米体重秤2</h3>
                <p class="aa">59元</p>
                <p class="aa">59元</p>
                <p class="bb">29.4万人好评</p>
            </div>
            <div class="tail-two cc">
                <img src="/mi/imgs/like2.png" alt="">
                <h3>Redmi K40</h3>
                <p class="aa">1999元</p>
                <p class="bb">59.4万人好评</p>
            </div>
            <div class="tail-three cc">
                <img src="/mi/imgs/like3.png" alt="">
                <h3>米家防飞溅指甲刀</h3>
                <p class="aa">9.9元</p>
                <p class="bb">67.4万人好评</p>
            </div>
            <div class="tail-four cc">
                <img src="/mi/imgs/like4.png" alt="">
                <h3>日常元素 毛巾青春款</h3>
                <p class="aa">19.9元</p>
                <p class="bb">12.4万人好评</p>
            </div>
            <div class="tail-five cc">
                <img src="/mi/imgs/like5.png" alt="">
                <h3>小米11青春版 马卡龙色系硅胶保护壳</h3>
                <p class="aa">49元</p>
                <p class="bb">1万人好评</p>
            </div>
            <div class="tail-six cc">
                <img src="/mi/imgs/like6.png" alt="">
                <h3>米家声波电动牙刷T300</h3>
                <p class="aa">99元</p>
                <p class="bb">22.9万人好评</p>
            </div>
            <div class="tail-seven cc">
                <img src="/mi/imgs/like7.png" alt="">
                <h3>米家电动剃须刀S500</h3>
                <p class="aa">179元</p>
                <p class="bb">18.6万人好评</p>
            </div>
            <div class="tail-eight cc">
                <img src="/mi/imgs/like8.png" alt="">
                <h3>米家电动剃须刀S100</h3>
                <p class="aa">78元</p>
                <p class="bb">21.5万人好评</p>
            </div>
            <div class="tail-nine cc">
                <img src="/mi/imgs/like9.png" alt="">
                <h3>小米10S</h3>
                <p class="aa">2999元</p>
                <p class="bb">17万人好评</p>
            </div>
            <div class="tail-ten cc">
                <img src="/mi/imgs/like10.png" alt="">
                <h3>小米11</h3>
                <p class="aa">3799元</p>
                <p class="bb">2316人好评</p>
            </div>
        </div>





        <!-- 删除商品的Modal -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="margin-top: 200px;">
            <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                
                </div>
                <div class="modal-body" style="font-size: 26px;width: 200px; height: 100px; margin: 50px auto;text-align: center;">
                确定要删除吗
                </div>
                <div class="modal-footer">
                <button type="button" class="btn" data-dismiss="modal" style="background-color: rgb(176, 176, 176); color: white;">取消</button>
                <button type="button" class="btn" style="background-color: rgb(242, 88, 7); color: white;"  onclick="del()">确定</button>
                </div>
            </div>
            </div>
        </div>


        <!-- 商品个数减一的Modal -->
        <div class="modal fade" id="reduceNumberModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="margin-top: 200px;">
            <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                
                </div>
                <div class="modal-body" style="width: 260px; height: 100px; margin: 50px auto;text-align: center;font-size: 26px;">
                修改个数不能小于0
                </div>
                <div class="modal-footer">
                <!-- <button type="button" class="btn" data-dismiss="modal" style="background-color: rgb(176, 176, 176); color: white;">取消</button> -->
                <button type="button" class="btn" style="background-color: rgb(242, 88, 7); color: white;"   onclick="sureCantReduce()">确定</button>
                </div>
            </div>
            </div>
        </div>
    </div>




    <!-- 底部公共部分 -->
    <%@include file="../common/page-bottom.jsp"%>



    <script src="/mi/plugins/jquery/jquery.min.js"></script>
    <script src="/mi/plugins/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="/mi/js/shopping_cart.js"></script>


    <script>
        $('#myModal').modal('hide')

        $(function(){
            //模拟一个参数 - 为了post请求,没有参数,默认的是get请求
            $("#outer").load("/mi/cart/asynCart")
        })

    </script>
</body>
</html>